<?php

namespace app\api\controller\im;

use app\api\controller\im\Base;
use app\api\validate\im\SnsValidate;
use app\logic\im\SnsLogic;

class Sns extends Base
{
    protected SnsLogic $snsLogic;

    public function initialize(): void
    {
        parent::initialize();
        $this->snsLogic = new SnsLogic();
    }

    /**
     * 好友列表
     */
    public function friendList()
    {
        // 实例化验证器对象，用于后续的参数验证
        $this->check(new SnsValidate(), $this->request->post());

        $data = $this->snsLogic->friendList($this->auth->id);

        // 返回成功发布动态的消息
        $this->success(__('success'), $data);
    }
}